3.168 \(\int \cos (e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=56 \[ \frac {a^2 \sin (e+f x)}{f}+\frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

[Out]

1/2*b*(4*a+b)*arctanh(sin(f*x+e))/f+a^2*sin(f*x+e)/f+1/2*b^2*sec(f*x+e)*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {4147, 390, 385, 206} \[ \frac {a^2 \sin (e+f x)}{f}+\frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Int[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(b*(4*a + b)*ArcTanh[Sin[e + f*x]])/(2*f) + (a^2*Sin[e + f*x])/f + (b^2*Sec[e + f*x]*Tan[e + f*x])/(2*f)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 390

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Int[PolynomialDivide[(a + b*x^n)
^p, (c + d*x^n)^(-q), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && IGtQ[p, 0] && ILt
Q[q, 0] && GeQ[p, -q]

Rule 4147

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^
((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n
/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \cos (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a+b-a x^2\right )^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left (a^2+\frac {b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {a^2 \sin (e+f x)}{f}+\frac {\operatorname {Subst}\left (\int \frac {b (2 a+b)-2 a b x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {a^2 \sin (e+f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f}+\frac {(b (4 a+b)) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=\frac {b (4 a+b) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a^2 \sin (e+f x)}{f}+\frac {b^2 \sec (e+f x) \tan (e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 80, normalized size = 1.43 \[ \frac {a^2 \sin (e) \cos (f x)}{f}+\frac {a^2 \cos (e) \sin (f x)}{f}+\frac {2 a b \tanh ^{-1}(\sin (e+f x))}{f}+\frac {b^2 \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {b^2 \tan (e+f x) \sec (e+f x)}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(2*a*b*ArcTanh[Sin[e + f*x]])/f + (b^2*ArcTanh[Sin[e + f*x]])/(2*f) + (a^2*Cos[f*x]*Sin[e])/f + (a^2*Cos[e]*Si
n[f*x])/f + (b^2*Sec[e + f*x]*Tan[e + f*x])/(2*f)

________________________________________________________________________________________

fricas [A]  time = 0.67, size = 94, normalized size = 1.68 \[ \frac {{\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (2 \, a^{2} \cos \left (f x + e\right )^{2} + b^{2}\right )} \sin \left (f x + e\right )}{4 \, f \cos \left (f x + e\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/4*((4*a*b + b^2)*cos(f*x + e)^2*log(sin(f*x + e) + 1) - (4*a*b + b^2)*cos(f*x + e)^2*log(-sin(f*x + e) + 1)
+ 2*(2*a^2*cos(f*x + e)^2 + b^2)*sin(f*x + e))/(f*cos(f*x + e)^2)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(sin(f*x+exp(1))*a^2/2-sin(f*x+exp(1))*b^2*1/4/(sin(f*x+ex
p(1))^2-1)-(4*a*b+b^2)/8*ln(abs(sin(f*x+exp(1))-1))+(4*a*b+b^2)/8*ln(abs(sin(f*x+exp(1))+1)))

________________________________________________________________________________________

maple [A]  time = 1.06, size = 78, normalized size = 1.39 \[ \frac {a^{2} \sin \left (f x +e \right )}{f}+\frac {2 a b \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {b^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{2 f}+\frac {b^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x)

[Out]

a^2*sin(f*x+e)/f+2/f*a*b*ln(sec(f*x+e)+tan(f*x+e))+1/2*b^2*sec(f*x+e)*tan(f*x+e)/f+1/2/f*b^2*ln(sec(f*x+e)+tan
(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 87, normalized size = 1.55 \[ -\frac {b^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a b {\left (\log \left (\sin \left (f x + e\right ) + 1\right ) - \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 4 \, a^{2} \sin \left (f x + e\right )}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/4*(b^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) - 4*a*b*(log(s
in(f*x + e) + 1) - log(sin(f*x + e) - 1)) - 4*a^2*sin(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 0.11, size = 55, normalized size = 0.98 \[ \frac {a^2\,\sin \left (e+f\,x\right )+\frac {b\,\mathrm {atanh}\left (\sin \left (e+f\,x\right )\right )\,\left (4\,a+b\right )}{2}-\frac {b^2\,\sin \left (e+f\,x\right )}{2\,\left ({\sin \left (e+f\,x\right )}^2-1\right )}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(e + f*x)*(a + b/cos(e + f*x)^2)^2,x)

[Out]

(a^2*sin(e + f*x) + (b*atanh(sin(e + f*x))*(4*a + b))/2 - (b^2*sin(e + f*x))/(2*(sin(e + f*x)^2 - 1)))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \cos {\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**2*cos(e + f*x), x)

________________________________________________________________________________________